<?
/**
 * 对外的操作
 */
 class shop_dwr
 {
 	public function commendList()
 	{
 		global $scfg;
 		$urs  	    = $_GET["urs"];
		$db_goods   = new db($scfg['db']['goods']);
		$rs 		= shop::shoprecommend($db_goods,$urs);
		foreach($rs as &$v)
		{
			$v["url"] = pct::url($v['gYmd'],$v['gid']);
			$v["img"] = pct::img($v['gYmd'],$v['gid']);
			$v["img"] = $v["img"][0];
			//$cSellType  = $v['cSellType'] == 1?"一口价":"拍卖";
		}
		echo json::flush($rs);
 	}
 	public function creditShow()
 	{
 		global $scfg;
 		$tmp = '<table cellspacing="0" cellpadding="0" width="98%" align="center" border="0">
		        <tbody>
		          <tr align="middle">
		            <td valign="bottom" align="left" colspan="3" height="40"><img hspace="5" src="http://pics.paipai.com/shop/rate_btn_seller.gif" align="absmiddle" vspace="5" />卖家信用： 947<span title="二钻卖家(301-1000个信用积分)  点击查看详情&gt;&gt;"><img src="http://pics.paipai.com/common/icon/seller12.gif" align="absmiddle" /></span></td>
		            <td valign="bottom" align="right" colspan="2">好评率:99%  </td>
		          </tr>
		        </tbody>
		      </table>
		      <table cellspacing="0" cellpadding="0" width="98%" align="center" border="0">
		        <tbody>
		          <tr class="line_solid line_border"  bordercolor="#FFFDDF" align="middle">
		            <td class="line_border2" width="20%"> </td>
		            <td width="20%"><strong><img height="24" hspace="2" src="http://pics.paipai.com/common/icon/rate_good.gif" width="24" align="absmiddle" />好评</strong></td>
		            <td width="20%"><img height="24" hspace="2" src="http://pics.paipai.com/common/icon/rate_normal.gif" width="24" align="absmiddle" /><strong>中评</strong></td>
		            <td width="20%"><img height="24" hspace="2" src="http://pics.paipai.com/common/icon/rate_bad.gif" width="24" align="absmiddle" /><strong>差评</strong></td>
		            <td width="20%"><strong>合计</strong></td>
		          </tr>
		          <tr class="line_solid"    align="middle">
		            <td  class="line_border2" align="left"><strong>  过去1周</strong></td>
		            <td>3</td>
		            <td>0</td>
		            <td>0</td>
		            <td>3</td>
		          </tr>
		          <tr class="line_solid"   align="middle">
		            <td class="line_border2" align="left"><strong>  过去1个月</strong></td>
		            <td>61</td>
		            <td>0</td>
		            <td>0</td>
		            <td>61</td>
		          </tr>
		          <tr  class="line_solid"   align="middle">
		            <td class="line_border2" align="left"><strong>  过去6个月</strong></td>
		            <td>409</td>
		            <td>0</td>
		            <td>0</td>
		            <td>409</td>
		          </tr>
		          <tr class="line_solid"   align="middle">
		            <td class="line_border2" align="left"><strong>  评价总数</strong></td>
		            <td>969</td>
		            <td>4</td>
		            <td>0</td>
		            <td>973</td>
		          </tr>
		          <tr>
		            <td colspan="5"></td>
		          </tr>
		        </tbody>
		      </table>
		      <table cellspacing="0" cellpadding="0" width="98%" align="center" border="0">
		        <tbody>
		          <tr align="middle">
		            <td valign="bottom" align="right" height="24"><a href="http://service.paipai.com/cgi-bin/go?pageId=10&amp;domainId=1&amp;linkId=52&amp;url=http%3A//shop1.paipai.com/cgi-bin/credit_info%3Fuin%3D85372581">查看卖家信用的详细情况</a></td>
		          </tr>
		        </tbody>
		      </table>';
		echo json::flush($tmp);
 	}
 	public function htmlTemExchangeLog()
 	{
 		$tmp = '<table id="price_list" align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
		          <tr align="center">
		            <td class="price_list_head" height="24">买家</td>
		            <td class="price_list_head">&nbsp;</td>
		            <td class="price_list_head">出价</td>
		            <td class="price_list_head">&nbsp;</td>
		            <td class="price_list_head">购买数量</td>
		            <td class="price_list_head">时间</td>
		            <td class="price_list_head">状 态</td>
		          </tr>
		          <tr class="LineBg0" align="center">
		            <td class="price_list_main" height="30"> 92‰詮*** (332601***)</td>
		            <td class="price_list_main" style="color: rgb(128, 128, 128);" align="left">(未公开)</td>
		            <td class="price_list_main">29.00元 </td>
		            <td class="price_list_main">&nbsp;</td>
		            <td class="price_list_main">1件 </td>
		            <td class="price_list_main">2007-09-01 21:05:59 </td>
		            <td class="price_list_main">成功 </td>
		          </tr>
		          <tr class="LineBg1" align="center">
		            <td class="price_list_main" height="30"> 92‰詮*** (332601***)</td>
		            <td class="price_list_main" style="color: rgb(128, 128, 128);" align="left">(未公开)</td>
		            <td class="price_list_main">29.00元 </td>
		            <td class="price_list_main">&nbsp;</td>
		            <td class="price_list_main">1件 </td>
		            <td class="price_list_main">2007-09-01 21:05:59 </td>
		            <td class="price_list_main">成功 </td>
		          </tr>
		          <tr class="LineBg0" align="center">
		            <td class="price_list_main" height="30"> 92‰詮*** (332601***)</td>
		            <td class="price_list_main" style="color: rgb(128, 128, 128);" align="left">(未公开)</td>
		            <td class="price_list_main">29.00元 </td>
		            <td class="price_list_main">&nbsp;</td>
		            <td class="price_list_main">1件 </td>
		            <td class="price_list_main">2007-09-01 21:05:59 </td>
		            <td class="price_list_main">成功 </td>
		          </tr>
		          <tr align="center">
		            <td colspan="7" class="tright" height="30"><span style=""> <a href="#" target="_blank"> 共有<span class="number b fontOrange"> 259 </span>人次参与出价，点此查看近期出价记录</a> </span> <span style=""> <a href="#" target="_blank">查看历史出价记录&gt;&gt;</a> </span> <span style="display: none;"> <a href="http://auction.paipai.com/cgi-bin/commodityinfo_exchange?sItemid=7270C10200000000007234D000895161&amp;iSellType=1&amp;TotalbuyCount=462&amp;edittime=1186215202&amp;snapver=5&amp;isHistory=0" target="_blank">查看最新出价记录&gt;&gt;</a> </span> </td>
		          </tr>
		        </table>';
		$tmp = '<div></div>';
		echo json::flush($tmp);
 	}
 	public function shopinfo()
 	{
 		global $scfg;
 		$urs  		= $_GET["urs"];
 		$db_goods   = new db($scfg['db']['goods']);
 		$db_member 	= new db($scfg['db']['member']);
 		$rs = shop::getShopInfo($db_goods,$db_member,$urs);
 		$rs["shop"] = shop::url($urs);
 		echo json::flush($rs);
 	}
 	public function priceRefresh()
 	{
 	    global $scfg;
 	    $tmp["price"] = "56.90";
		echo json::flush($tmp);
 	}
 	public function statePct()
 	{
 	    global $scfg;
 	    $arr	  	= pct::de($_GET["id"]);
 		$db_goods   = new db($scfg['db']['goods']);
 		$rs = pct::statePct($db_goods,$arr["gYmd"],$arr["gid"]);
 		echo json::flush($rs);
 	}
 }
 /**
  * 下面是程序路由
  */
 if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"]))
 {
	 require('../inc.php');
	 $Pact = $_REQUEST["Pact"];
	 $Pact && route("shop_dwr",$Pact);
 }
?>